﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Master/HomeMaster.Master"
    CodeBehind="Info.aspx.cs" Inherits="CSP.Web.MyHome.ContactWay.Info" %>

<asp:Content ID="CSPHead" ContentPlaceHolderID="CSPHead" runat="server">
    <meta charset="utf-8">
    <title>联系方式</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
</asp:Content>
<asp:Content ID="CSPStyleAndScript" ContentPlaceHolderID="CSPStyleAndScript" runat="server">
    <script type="text/javascript" src="/Scripts/Validate/validate.js"></script>
    <link href="/Styles/lib/jquery-ui/jquery-ui-1.8.22.custom.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/lib/jquery-ui/jquery.ui.button.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/UI/Jquery/jquery.ui.core.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.widget.min.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.position.min.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.dialog.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Expand/dialog.js" type="text/javascript"></script>
    <script language="javascript">
        $().ready(function () {
            $("#MyHome").validate();
        });

        function deleteConfirm(id) {
            DialogMessage.Init("提示", "确定要删除此条信息？").dialog({
                resizable: false,
                width: 300,
                height: 140,
                modal: true,
                buttons: {
                    "确定": function () {
                        $(this).dialog("close");
                        $.ajax({
                            type: "get",
                            dataType: "json",
                            //data: { OrderNumber: ordernumber, ShipmentID:shipmentID, Notes: notes, Action: "CancelShipmentByID" },
                            url: "Info.aspx?deleteid=" + id,
                            async: false,
                            error: function (result) {
                                result;
                            },
                            success: function (data, textStatus) {
                                data;
                                //执行成功
                                if (data.status == 1) {
                                    dilaogMessage(1, data.msg, function () {
                                        window.location.href = "info.aspx";
                                    });

                                }
                                else if (data.status == 2)//警告
                                {
                                    dilaogMessage(2, data.msg);
                                }
                                else {
                                    dilaogMessage(0, data.msg);
                                }
                            }
                        });

                    },
                    "取消": function () {
                        $(this).dialog("close");
                    }
                }
            });
        }

        //弹出message信息框 status=0错误,1成功，2警告
        function dilaogMessage(status, msg, fn) {

            //var dialogObj = $('<div id="dialog-message" title="Success"><span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span><div>111</div></div>');
            //dialogObj.find("div").html(msg);
            var dialogObj;
            if (status == 0) {
                dialogObj = DialogMessage.Init("Error", msg);
            } else if (status == 1) {

                dialogObj = DialogMessage.Init("Successfully", msg);
            } else if (status == 2) {
                dialogObj = DialogMessage.Init("Warn", msg);
            }

            dialogObj.dialog({
                modal: true,
                buttons: {
                    确定: function () {
                        $(this).dialog("close");
                        fn();
                    }
                }
            });

        }
    </script>
</asp:Content>
<asp:Content ID="CSPCrumbs" ContentPlaceHolderID="CSPCrumbs" runat="server">
    <div class="crumbs">
        <span>您当前所在的位置：</span> <a href="/">首页</a> &gt; <a href="/MyHome/Account/Management.aspx">我的家园</a> &gt; <span>联系方式</span>
    </div>
    <!--crumbs-->
</asp:Content>
<asp:Content ID="CSPRight" ContentPlaceHolderID="CSPRight" runat="server">
    <div class="pr10">
        <div class="tabs tabs-home mt10">
            <div class="tabs-nd">
                <ul class="tabs-hd">
                    <li class="trigger current">联系方式</li>
                </ul>
            </div>
            <div class="tabs-bd">
                <div class="tabs-panel">
                    <table width="90%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="50" align="right">
                                <strong class="fc-red">
                                    <asp:Label ID="LB_Title" runat="server">新增联系方式</asp:Label>
                                </strong>
                            </td>
                            <td colspan="2">
                                &nbsp;
                            </td>
                            <td rowspan="5">asdfaf</td>
                        </tr>
                        <tr>
                            <td width="29%" height="50" align="right">
                                <span class="fc-red">*</span>联系人姓名：
                            </td>
                            <td colspan="2">
                                <input name="textfield" type="text" maxlength="10" runat="server" id="Txt_Name" size="20"
                                    class="{required:true,maxlength:25}">
                            </td>
                        </tr>
                        <tr>
                            <td height="50" align="right">
                                <span class="fc-red">*</span> 联系方式：
                            </td>
                            <td width="9%">
                                <label>
                                    <asp:RadioButton ID="RD_QQ" runat="server" GroupName="Radio" />
                                    QQ</label>
                            </td>
                            <td width="62%">
                                <label>
                                    <asp:RadioButton ID="RD_WangWang" runat="server" GroupName="Radio" />
                                    阿里旺旺</label>
                            </td>
                        </tr>
                        <tr>
                            <td height="50" align="right">
                                <span class="fc-red">*</span>用户名/号码：
                            </td>
                            <td colspan="2">
                                <input name="textfield5" type="text" runat="server" id="Txt_Address" size="20" class="{required:true}">
                            </td>
                        </tr>
                        <tr>
                            <td height="60" align="center">
                            </td>
                            <td height="60" colspan="2" align="left" valign="top">
                                <input type="submit" class="ui-btn-confirm" id="BtnSubmit" onserverclick="BtnSubmit_Click"
                                    runat="server" value="保存">&nbsp;
                            </td>
                        </tr>
                    </table>
                    <asp:Repeater ID="R_ContactWay" ViewStateMode="Disabled" runat="server">
                        <HeaderTemplate>
                            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table-style mtb15">
                                <thead>
                                    <tr>
                                        <th width="15%" scope="col">
                                            序号
                                        </th>
                                        <th width="25%" align="left" scope="col">
                                            <div id="u78">
                                                <div id="u78_rtf">
                                                    <p>
                                                        用户名/号码</p>
                                                </div>
                                            </div>
                                        </th>
                                        <th width="22%" align="left" scope="col">
                                            <div id="u80">
                                                <div id="u80_rtf">
                                                    <p>
                                                        联系称呼</p>
                                                </div>
                                            </div>
                                        </th>
                                        <th width="19%" align="left" scope="col">
                                            联系类型
                                        </th>
                                        <th width="19%" scope="col">
                                            操作
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td height="40" align="center">
                                    <%#Container.ItemIndex+1 %>
                                </td>
                                <td>
                                    <%# Eval("Address") %>
                                </td>
                                <td>
                                    <%# Eval("NickName")%>
                                </td>
                                <td align="left">
                                    <a target="_blank" href='<%#GetContactURL(Eval("Address").ToString(),Convert.ToInt32(Eval("Type").ToString()),1) %>'>
                                        <img border="0" align="absmiddle" src="<%#GetContactURL(Eval("Address").ToString(),Convert.ToInt32(Eval("Type").ToString()),0) %>"
                                            alt="点击这里给我发消息" title="点击这里给我发消息">
                                    </a>
                                </td>
                                <td align="center" class="operate">
                                    <a href="Info.aspx?modifyid=<%#Eval("Id") %>">编辑</a> | <a href="javascript:deleteConfirm('<%#Eval("Id") %>')">
                                        删除</a>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            <tr>
                                <td colspan="5" style="text-align: center">
                                    <asp:Label ID="LB_Empty" runat="server" Text=""><%=R_ContactWay.Items.Count == 0 ? "暂无数据" : ""%></asp:Label>
                                </td>
                            </tr>
                            </tbody> </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </div>
                <!--tabs-panel-->
            </div>
            <!--tabs-bd-->
        </div>
        <!--tabs-->
    </div>
</asp:Content>
